package Servidor;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;

import Principal.MedicSoft;

import Interfaces.MedicSoftInterface;;

public class Servidor {
	private MedicSoftInterface sistema;
	public Servidor(){
		inicializarSistema();
		publicar();
	}
	private void inicializarSistema(){
		try {
			sistema = new MedicSoft();
		} catch (RemoteException e) {
			e.printStackTrace();
		}
	}
	private void publicar(){
		try {
			LocateRegistry.createRegistry(1099);
			Naming.rebind("//localhost/MedicSoft",sistema);
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
	}
}
